package shapewar.view.tank;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import shapewar.conf.Conf;
import shapewar.engine.calc.Pos;
import shapewar.engine.model.Bullet;
import shapewar.engine.model.abst.Model;
import shapewar.engine.presenter.Presenter;
import shapewar.view.myview.MyView;
import shapewar.view.myview.PaintFilter;

public class BulletView extends MyView{
	Bullet blt = (Bullet) getModel();
	private int color = Conf.bullet_color;
	public BulletView(Presenter pst, Model shape) {
		super(pst, shape);
		//this.color  = ((TankView)(blt.getFather().getView())).getColor();
		paint.setColor(color);
		//paint.setMaskFilter(PaintFilter.getMaskFilter());
	}
	
	@Override
	protected void onDraw(Canvas canvas) {
		if (!isNearFrameWindow())return;
		Pos rpos = getRelativePos();
		canvas.drawCircle(rpos.x, rpos.y, blt.r * rate, paint);
	}
	
}
